<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .chose-tit{
        border:1px solid #ccc;
        text-align: left;
        width:33.33%
    }

    .qution-tit{
        background-color:#003D4C;
        color: white;
        padding:6px 5px;
    }
</style>
<body>
    <div>
        <div>
            <a href="javascript:history.go(-1)">
                <button class="btn btn-success">返回</button>
            </a>
            <a href="<?= url('question_format/getquestionnaireexcelfile?qid='. $info['id']) ?>">
                <button class="btn btn-success">生成Excel</button>
            </a>
        </div>
    </div>
    <div style="text-align:center;">
        <div style="color:#7BCBB0;font-size:large;">{$info.name}</div>
        <div style="background-color:#F5F5F5;width:90%">
            <div style="text-align:left;min-height: 50px;">
                {$info.header_note}

            </div>
        </div>
        
        <div style="background-color:#F8F8F8;width:90%;margin-top: 50px;text-align: left;">
            <div style="font-weight:600">
                填写总数：{$count}
            </div>
  
            {foreach name="$info['format']" key='i'  item="vo"}
                {if $vo['type'] == 0}
                    <div class="qution-tit">{$i+1}.{$vo.title}(單選題)</div>
                    {foreach name="$vo['option']" key='i0'  item='op'}
             
                    <div style="display:flex;">
                        <div  class="chose-tit">
                            {$op}
                        </div>
                        <?php
                            $total = statisQustionByChose($info['id'],$i,0,$i0);
                            $num = getNumRatio($total,$count);
                        ?>
                        <div class="chose-tit">
                            遐择数:{$total}
                        </div>
                        <div class="chose-tit">
                            占比数:{$num}%
                        </div>
                    </div>
                    {/foreach}
                
                {/if}

                {if $vo['type'] == 1}
                    <div  class="qution-tit">{$i+1}.{$vo.title}(多選題)</div>
                    {foreach name="$vo['option']" key='i1' item='op1'}
             
                    <div style="display:flex;">
                        <div  class="chose-tit">
                            {$op1}
                        </div>
                        <?php
                        $total = statisQustionByChose($info['id'],$i,1,$i1);
                        $num = getNumRatio($total,$count);
                        ?>
                        <div class="chose-tit">
                            遐择数: {$total}
                        </div>
                        <div class="chose-tit">
                            占比数:{$num}%
                        </div>
                    </div>
                    {/foreach}
                
                {/if}

                {if $vo['type'] == 6}
                    <div  class="qution-tit">{$i+1}.{$vo.title}(跳题)</div>
                    {foreach name="$vo['option']"  key='i6' item='op6'}
             
                    <div style="display:flex;">
                        <div  class="chose-tit">
                            {$op6}
                        </div>
                        <?php
                        $total = statisQustionByChose($info['id'],$i,6,$i6);
                        $num = getNumRatio($total,$count);
                        ?>
                        <div class="chose-tit">
                            遐择数: {$total}
                        </div>
                        <div class="chose-tit">
                            占比数:{$num}%
                        </div>
                    </div>
                    {/foreach}
                
                {/if}

                {if $vo['type'] == 2}
                    <div  class="qution-tit">{$i+1}.{$vo.title}(填空题)</div>
                    
                    <?php
                        $arr_str = statisQustionType_2($info['id'],$i);
                    ?>
                    <div style="display:flex;flex-wrap: wrap;" >
                        {foreach  name="$arr_str" key='k' item="type_2"}
                        <div  class="chose-tit">
                            {$type_2}
                        </div>
                        {/foreach}
                    </div>
                   
           
                {/if}

                {if $vo['type'] == 3}
                    <div  class="qution-tit">{$i+1}.{$vo.title}(單項填空題)</div>
                    
                    <?php
                        $arr_str = statisQustionType_2($info['id'],$i,3);
                    ?>
                    <div style="display:flex;flex-wrap: wrap;" >
                        {foreach  name="$arr_str" key='k' item="type_2"}
                        <div  class="chose-tit">
                            {$type_2}
                        </div>
                        {/foreach}
                    </div>
                   
           
                {/if}

                {if $vo['type'] == 4}
                    <div  class="qution-tit">{$i+1}.{$vo.title}(矩陣單選題)</div>
                    {foreach name="$vo['title_list']" key='k' item="ju"}
                    <div style="display:flex;">
                        
                        <div  class="chose-tit">
                            {$ju}
                        </div>
                        <div class="chose-tit">
                            
                        </div>
                        <div class="chose-tit">
                            
                        </div>
                        
                    </div>
                        {foreach name="$vo['option']" key='i4' item="op4"}
                        <div style="display:flex;">
                            
                            <div  class="chose-tit">
                                {$op4}
                            </div>
                            <?php
                            $total = statisQustionByChose($info['id'],$i,4,$k,$i4);
                            $num = getNumRatio($total,$count);
                            ?>
                            <div class="chose-tit">
                                遐择数: {$total}
                            </div>
                            <div class="chose-tit">
                                占比数:{$num}%
                            </div>
                            
                        </div>
                        {/foreach}
                    {/foreach}
           
                {/if}
            {/foreach}
            
        </div>
    </div>
</body>
</html>